Skip to content

Fix repeated failure to load DSC module #2020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 8, 2023
Merged

Conversation

andyleejordan
Copy link
Member

While debugging the Write-Output bug (hence the branch name) I came across another bug where the server was attempting to load the DSC module repeatedly. The SetLineBreakpoint logic queries for DSC breakpoint capability, which was importing the module, catching the failure to import as an error, and then trying again every single time. Instead we should import (or fail to import) only the first time we try. Also, we don't need to transform the BreakpointDetails list into an array and back, just leave it as IEnumerable.

This can just be an `IEnumerable` throughout instead.
Instead of trying repeatedly every time we set a breakpoint.
The way the class properties are accessed changed.
@andyleejordan andyleejordan force-pushed the andschwa/write-output branch from 4381cfc to 6790594 Compare May 5, 2023 20:16
@andyleejordan andyleejordan marked this pull request as ready for review May 5, 2023 20:59
@andyleejordan andyleejordan requested a review from a team May 5, 2023 20:59
Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I'd personally remove the enumerable change for maintainability but I'll leave that up to your discretion

…ions

Seems to be the easiest "clean and safe" way to handle this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants